package com.xiaobawang.hundouluo.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class Environment implements Parcelable {
    private String status;
    private Double data;
    private String unit;
    private String name;

    public Environment() {
    }

    public Environment(String status, Double data, String unit, String name) {
        this.status = status;
        this.data = data;
        this.unit = unit;
        this.name = name;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Double getData() {
        return data;
    }

    public void setData(Double data) {
        this.data = data;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Environment{" +
                "status='" + status + '\'' +
                ", data=" + data +
                ", unit='" + unit + '\'' +
                ", name='" + name + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeString(this.status);
        parcel.writeDouble(this.data);
        parcel.writeString(this.unit);
        parcel.writeString(this.name);
    }

    public static final Parcelable.Creator<Environment> CREATOR = new Parcelable.Creator<Environment>(){

        @Override
        public Environment createFromParcel(Parcel parcel) {
            return new Environment(
                    parcel.readString(),
                    parcel.readDouble(),
                    parcel.readString(),
                    parcel.readString()
            );
        }

        @Override
        public Environment[] newArray(int i) {
            return new Environment[i];
        }
    };

}
